package wyx240419;

import jakarta.servlet.*;
import jakarta.servlet.http.*;
import java.io.*;
public class Day01 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        String name = req.getParameter("name");
        String sex = req.getParameter("sex");
        PrintWriter out = resp.getWriter();
        out.printf("<html><body><h1>Hello 你好%s%s</h1></body></html>",(name==null?"":name),(sex==null?"": sex.equals("男") ?"先生":"女士"));
    }
}
